{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>权限组</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->
            <div class="row">
                <div class="col-sm-12">
                    <form id="search-form" role="form" class="form-search form-inline" method="get"
                          action="{:\\think\\Url::build('index')}">
                        <!-- 默认主键倒序排序 -->
                        <input type="hidden" name="_order" value="id">
                        <input type="hidden" name="_sort" value="asc">
                        <div class="form-group">
                            <div class="input-group">
                                {one:menu menu="add" /}
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="title" class="sr-only">分组名称</label>
                            <input id="title" class="form-control" type="text" name="title"
                                   value="{$Request.param.title}" placeholder="分组名称">
                        </div>
                        <button class="btn btn-primary" type="submit"><i class="fa fa-search"></i> 搜索</button>
                    </form>
                </div>
            </div>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>
            <!--动态加载数据部分-->
            <div id="ajax_table" class="ajax_table">
                <div class="data-table table-responsive">
                    <table class="table table-bordered table-hover">
                        <thead>
                        <tr class="table-text-c">
                            <th>ID</th>
                            <th>分组名称</th>
                            <th>状态</th>
                            <th>备注</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {notempty name="list"}
                        {volist name="list" id="vo"}
                        <tr class="table-text-c">
                            <td>{$vo.id}</td>
                            <td>{$vo.title}</td>
                            <td>{$vo.status|get_status}</td>
                            <td>{$vo.remark}</td>
                            <td>
                                <a href="javascript:;" onclick="auth('{:\\think\\Url::build(\'auth\', [\'id\'=>$vo.id])}')" class="btn btn-primary btn-xs btn-outline"><i class="fa fa-key"></i> 授权</a>
                                {one:menu menu='edit' url='edit:id=$vo.id' /}
                            </td>
                        </tr>
                        {/volist}
                        {else /}
                        <tr class="table-text-c">
                            <td colspan="100"><i class="fa fa-info-circle"></i> 暂无数据</td>
                        </tr>
                        {/notempty}
                        </tbody>
                    </table>
                </div>
                <div class="text-center">{$page}</div>
                <div class="text-right">共{$count}条数据，第{$nowPage}页，共{$allPage}页</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    function auth(url) {
        //iframe层-父子操作
        layer.open({
            type: 2,
            title: '权限分配',
            area: ['50%', '70%'],
            fixed: false, //不固定
            maxmin: true,
            content: url
        });
    }
</script>
</body>
</html>
